﻿namespace WMS6.Web.Analytics
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;
    using WMS6.Web.UserControls;

    public class LocationRptQuery : BasePage
    {
        protected Button btnSearch;
        protected DropDownList ddlAbcOper;
        protected DropDownList ddlLoc;
        protected DropDownList ddlLocFlagOper;
        protected DropDownList ddlLocUsageOper;
        protected DropDownList ddlStatusOper;
        protected DropDownList ddlZoneID;
        protected HtmlForm F15220;
        protected HtmlInputHidden hdnActionID;
        protected Label lblAbc;
        protected Label lblLoc;
        protected Label lblLocFlag;
        protected Label lblLocUsage;
        protected Label lblShipmentOrderRpt;
        protected Label lblStatus;
        protected Label lblZoneID;
        protected MultipleSelectControl MSCAbc;
        protected MultipleSelectControl MSCLocFlag;
        protected MultipleSelectControl MSCLocUsage;
        protected MultipleSelectControl MSCStatus;
        protected HtmlLink mycss;
        protected TextBox txtLoc;
        protected TextBox txtZoneID;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("LocationRptList.aspx", false);
        }

        private void InitDropDownLists()
        {
            base.InitQueryDDL(this.ddlLoc, 0);
            base.InitQueryDDL(this.ddlZoneID, 0);
            base.InitQueryDDL(this.ddlLocUsageOper, 0);
            base.InitQueryDDL(this.ddlAbcOper, 0);
            base.InitQueryDDL(this.ddlStatusOper, 0);
            base.InitQueryDDL(this.ddlLocFlagOper, 0);
            base.BindData2DDLBySysCode(this.MSCLocUsage, "LocUsage");
            this.ddlLocUsageOper.SelectedValue = "One Of";
            base.BindData2DDLBySysCode(this.MSCAbc, "ABC");
            this.ddlAbcOper.SelectedValue = "One Of";
            base.BindData2DDLBySysCode(this.MSCStatus, "LocFlag");
            this.ddlStatusOper.SelectedValue = "One Of";
            base.BindData2DDLBySysCode(this.MSCLocFlag, "LocFlag");
            this.ddlLocFlagOper.SelectedValue = "One Of";
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.InitDropDownLists();
            }
        }

        public string Abc
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCAbc.ReturnValue))
                {
                    return base.GetParamsString(this.MSCAbc.ReturnValue, this.ddlAbcOper.SelectedValue);
                }
                return "";
            }
        }

        public string Loc
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLoc.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLoc.Text.Trim(), this.ddlLoc.SelectedValue);
                }
                return "";
            }
        }

        public string LocFlag
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCLocFlag.ReturnValue))
                {
                    return base.GetParamsString(this.MSCLocFlag.ReturnValue, this.ddlLocFlagOper.SelectedValue);
                }
                return "";
            }
        }

        public string LocUsage
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCLocUsage.ReturnValue))
                {
                    return base.GetParamsString(this.MSCLocUsage.ReturnValue, this.ddlLocUsageOper.SelectedValue);
                }
                return "";
            }
        }

        public string Status
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCStatus.ReturnValue))
                {
                    return base.GetParamsString(this.MSCStatus.ReturnValue, this.ddlStatusOper.SelectedValue);
                }
                return "";
            }
        }

        public string ZoneID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtZoneID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtZoneID.Text.Trim(), this.ddlZoneID.SelectedValue);
                }
                return "";
            }
        }
    }
}

